<?php
 require_once('conn.php'); 
 header("content-type:text/html;charset=utf-8"); 
 if(!isset($_GET["urls"]) || $_GET["urls"]==""){
	 $urls="vt.php";
 }else{
	 $urls=$_REQUEST["urls"];
 } 
 $query = mysql_query("select * from xh_subject",$conn);
 if(mysql_num_rows($query)<=0){
	 mysql_close($conn);
	 echo "<script language='javascript' type='text/javascript'>alert('没有任何主题项');window.close();</script>";
	 exit();
 }
 echo "document.write(\"<\");\r\n";
 echo "document.write(\"table border='0' cellspacing='1' cellpadding='3' width='100%' align='center'>\");\r\n";
 while($row=mysql_fetch_array($query))
 {
	 echo "document.write(\"<\");\r\n";
	 echo "document.write(\"tr>\");\r\n";
	 
	 echo "document.write(\"<\");\r\n";
     echo "document.write(\"td align='center'>\");\r\n";
     
	 echo "document.write(\"<\");\r\n";
	 echo "document.write(\"a href='".$urls."?sid=".$row["id"]."' target='_blank'>".$row["subject"]."\");\r\n";
	 echo "document.write(\"<\");\r\n";
	 echo "document.write(\"/a>\");\r\n";

	 echo "document.write(\"<\");\r\n";
	 echo "document.write(\"/td>\");\r\n";
	 
	 echo "document.write(\"<\");\r\n";
	 echo "document.write(\"/tr>\");\r\n";
 }
 
 echo "document.write(\"<\");\r\n";
 echo "document.write(\"tr>\");\r\n";
	 
 echo "document.write(\"<\");\r\n";
 echo "document.write(\"td align='center' nowrap>\");\r\n";
 

 echo "document.write(\"<\");\r\n";
 echo "document.write(\"/td>\");\r\n";
	 
 echo "document.write(\"<\");\r\n";
 echo "document.write(\"/tr>\");\r\n";

 echo "document.write(\"<\");\r\n";
 echo "document.write(\"/table>\");\r\n";
 mysql_close($conn);
?>